import axios from './axios.js'

// 查询部门下拉树结构
export function treeselect() {
  return axios.request({
    url: 'api/system/dept/treeselect',
    method: 'get'
  })
}

// 查询部门列表
export function getDeptList(query) {
  return axios.request({
    url: 'api/system/dept/list',
    method: 'get',
    params: query
  })
}

export function addDept(data) {
  return axios.request({
    url: 'api/system/dept',
    method: 'post',
    data: data
  })
}

export function updateDept(data) {
  return axios.request({
    url: 'api/system/dept',
    method: 'put',
    data: data
  })
}

export function delDept(id) {
  return axios.request({
    url: 'api/system/dept/'+id,
    method: 'delete'
  })
}